# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=eazy
pkgver=0.1
pkgrel=5
groups=('blackarch' 'blackarch-scanner' 'blackarch-webapp')
pkgdesc='This is a small python tool that scans websites to look for PHP shells, backups, admin panels, and more.'
arch=('any')
url='http://packetstormsecurity.com/files/117572/EAZY-Web-Scanner.html'
license=('unknown')
depends=('python2')
source=('https://dl.packetstormsecurity.net/UNIX/scanners/EAZY.zip')
sha512sums=('27f9f9c405c3b7a2340012e187116c32cae59a7e351a39f36e34dce2d947a441343959f485956fbec1d8317fc99a667e95a5937ce783aa90fa31c3c8c3f37c43')

prepare() {
  cd EAZY

  sed -i '1i\#!/usr/bin/env python2' my.py
}

package() {
  cd EAZY

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 my.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

